<template>

  <el-form v-loading="loading">
    <el-card class="box-card" shadow="never" style="margin-bottom: 16px">

      <el-row :gutter="20">
        <el-col>
          <el-table :data="tableData" border style="width: 100%">
            <el-table-column align="center" label="操作" width="60">
              <template #default="{row}">
                <el-button type="text" @click="handleView(row,1)">查看</el-button>
              </template>
            </el-table-column>

            <el-table-column prop="calcSchemeCode" min-width="125" show-overflow-tooltip align="center" label="额度申请编号">
            </el-table-column>
            <el-table-column prop="orderCarId" min-width="200" show-overflow-tooltip align="center" label="订单编号">
              <template #default="{row}">
                <el-button type="text" @click="handleView(row,2)">{{ row.orderCarCode }}</el-button>
              </template>
            </el-table-column>
            <el-table-column prop="lessorName" show-overflow-tooltip align="center" label="出租方">
            </el-table-column>
            <el-table-column prop="leaseeName" show-overflow-tooltip align="center" label="承租方">
            </el-table-column>
            <el-table-column prop="carPowerTypeStr" show-overflow-tooltip align="center" label="能源类型">
            </el-table-column>
            <el-table-column prop="appearanceColor" show-overflow-tooltip align="center" label="颜色">
            </el-table-column>
            <el-table-column prop="planRent" show-overflow-tooltip align="center" label="月租金（元）">
            </el-table-column>

            <el-table-column prop="planTenancyTypeStr" show-overflow-tooltip align="center" label="租期（月）">
            </el-table-column>
            <el-table-column prop="attachedDecorationAmount" show-overflow-tooltip align="center" label="加装费（元）">
            </el-table-column>
            <el-table-column prop="operationTypeStr" show-overflow-tooltip align="center" label="使用性质">
            </el-table-column>
            <el-table-column prop="deliveryTime" show-overflow-tooltip align="center" label="交车时间">
            </el-table-column>
            <el-table-column prop="deliveryUserName" show-overflow-tooltip align="center" label="交车工作人员">
            </el-table-column>

          </el-table>
        </el-col>
      </el-row>


    </el-card>
  </el-form>

</template>

<script>
import {getContractMessage} from "@/api/zcwh/vehicleTabs.js";

export default {
  name: 'index',
  props: ['carId'],
  computed: {},
  watch: {},
  data() {
    return {
      detailForm: {},
      tableData: [],
      loading: false,
      status: ''
    };
  },
  created() {
    this.handleData()
  },
  mounted() {
  },
  methods: {
    async handleData() {
      this.loading = true
      try {
        const res = await getContractMessage(this.carId)
        this.tableData = res.data
      } catch (e) {

      } finally {
        this.loading = false
      }

    },

    handleView(row, type) {
      if (type === 1) {
        this.$router.push({
          path: '/vehicleOrder/suborderManagement/SuborderDetail',
          query: {
            id: row.orderCarId,
            orderCarCode: row.orderCarCode,
            beFrom: "VehicleDetails",
          }
        })
      }
      if (type === 2) {
        this.$router.push({
          path: '/vehicleOrder/orderManagement/OrderDetails',
          query: {
            type: row.carType,
            beFrom: "VehicleDetails",
            orderId: row.orderId,
            preOrderId: row.preOrderId,
            calcSchemeId: row.calcSchemeId,
          }
        })
      }
    }
  },
};
</script>

<style scoped lang=""></style>


